import { Link, useNavigate } from "react-router-dom"
const Login = () => {
    const navigate = useNavigate()
    return (
        <div>
            <h1>Login</h1>
            {/* 声明式路由写法 */}
            <Link to="/article">跳转至文章页</Link>

            {/* 命令式路由写法 */}
            <button onClick={() => {navigate('/article')}}>跳转至文章</button>

            <button onClick={() => {navigate('/article?id=100&name=jack')}}>searchParams传参</button>
            <button onClick={() => {navigate('/article/1001')}}>Params传参</button>
        </div>
    )
}

export default Login